<?php
/*
<Controller Information> 
Author: Naseer Ahmad
Date: 13-10-2011
Last Updated on:
*/

class usersManagerController extends appController
{
	function index()
	{
		$arrUsers = $this -> usersManager -> _getArrayData("usersInfo", "*", "userType='Member' and userStatus<>'Deleted' Order By userRegistrationDate DESC");
		$this -> set("arrUsers", $arrUsers);
		
		$this -> set("cmd", $this->data['cmd']);
		
		$this -> render('Users Manager');
	}
	
	function updateStatus(){
		$fv=array("userStatus"	=> $this->data['status']);
		$where = array("userID"	=> $this->data['userId']);
		$rs = $this -> usersManager -> _updateTable("usersInfo", $fv, $where);
		if($rs) $cmd="User Status Successfully Changed!"; else $cmd=$this -> usersManager -> getError();
		$rdArr = array("page"	=> "usersManager",
				 "cmd"		=> $cmd);
		$this->redirect($rdArr);

		
	}
	
}
?>